import React, { useState } from 'react'
import store from '../redux/store'

export default function City(props) {
    const [list] = useState(["北京", "上海", "广州", "深圳"])
    return (
        <div>
            <ul>
                {
                    list.map(item => {
                        return <li key={item} style={{ lineHeight: '50px' }} onClick={() => {
                            store.dispatch({
                                type: 'change-city',
                                cityName: item
                            })
                            props.history.push('/cinemas')
                        }}>{item}</li>
                    })
                }
            </ul>
        </div>
    )
}
